<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/5/27 0027
 * Time: 21:37
 */

namespace app\video\model;


use think\Model;

class Video extends Model
{
    public static function groupByType($type,$page,$count){
        return self::where("type",$type)
            ->paginate($count,false,[
           "page" =>$page,
        ]);
    }

    public static function getByTitle($name){
        return self::whereLike("title","%".$name."%")->select();
    }

    public static function getByID($id){
        return self::where("id",$id)->find();
    }
}